import java.io.*;

public class Practice6_1 {
	public static void main(String[] args) throws IOException {
		File file = new File("mid.txt");
		
        FileOutputStream out = new FileOutputStream(file);
        DataOutputStream dout = new DataOutputStream(out);

		for(int i = 1000; i < 1010; i++) {
			dout.writeInt(i);
		}
        dout.close();
        
        FileInputStream in = new FileInputStream(file);
		DataInputStream din = new DataInputStream(in);
		
		while(din.available()>0) {
			System.out.print(din.readInt()+" ");
		}

		din.close();
	}
}
